# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de>
# Contributor: speps <speps at aur dot archlinux dot org>
# Contributor: Philipp Überbacher <murks at lavabit dot com>
# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>
pkgname=jaaa
pkgver=0.9.2
pkgrel=2
pkgdesc="JACK and ALSA Audio Analyser"
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/"
license=('GPL2')
groups=('pro-audio')
depends=('clthreads' 'clxclient' 'fftw' 'jack' 'zita-alsa-pcmi')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2")
sha512sums=('bddc08774891e7cfda11a58b87b4150131577c8a4a200b7420e20937cb9fea264b9d3c335e56456d0040ec0d4ff0324821606dca85c96e43b4e3b0afe50ac83b')

prepare() {
  cd "$pkgname-$pkgver"
  # remove optimization
  sed -e '/march=native/d' \
      -i source/Makefile
}

build() {
  cd "$pkgname-$pkgver/source"
  make LIBDIR=lib
}

package() {
  cd "$pkgname-$pkgver/source"
  make PREFIX=/usr DESTDIR="$pkgdir/" install

  # doc
  install -vDm 644 ../{AUTHORS,README} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}

